# !/usr/bin/env python
# -*- coding: UTF-8 -*-
import cv2
import numpy as np
import sys
import math

# 通过蓝线的中点，进行距离上面的修正


# 通过端点得到中点坐标
def get_slope(point1, point2):
    if point1[0] > point2[0]:
        k = (float(point1[1]) - float(point2[1])) / (float(point1[0] - point2[0]))
        angle = - math.atan(k) / np.pi * 180
        print('angle:', angle)

    elif point2[0] > point1[0]:
        k = (float(point1[1]) - float(point2[1])) / (float(point1[0] - point2[0]))
        angle = - math.atan(k) / np.pi * 180
        print('angle:', angle)
    else:
        print("zero")


# 获得中点坐标
def mid_points_distance(points1, points2):
    points3_x = (float(points1[0]) + float(points2[0])) / 2
    points3_y = (float(points1[1]) + float(points2[1])) / 2
    points3 = (points3_x, points3_y)

    print("points3_y:", points3_y)


